package com.funny.learning.english;

import java.util.ArrayList;

import android.app.Application;

import com.facebook.SessionDefaultAudience;
import com.funny.learning.english.db.ContactDAO;
import com.funny.learning.english.model.CourseEntity;
import com.funny.learning.english.model.LanguageEntity;
import com.funny.learning.english.model.UserEntity;
import com.sromku.simple.fb.Permission;
import com.sromku.simple.fb.SimpleFacebook;
import com.sromku.simple.fb.SimpleFacebookConfiguration;

public class LeaningEnglishAppication extends Application {
	private UserEntity userEntity;
	
	private ArrayList<LanguageEntity> languageEntities;
	
	private CourseEntity courseEntity;
	
	private LanguageEntity languageEntity;
	
	private ArrayList<CourseEntity> arrCourse;
	
	private ContactDAO contactDAO;
	
	private boolean isLogin = false;
	
	public ArrayList<CourseEntity> getArrCourse() {
		return arrCourse;
	}

	public void setArrCourse(ArrayList<CourseEntity> arrCourse) {
		this.arrCourse = arrCourse;
	}

	private int levelSelect = 0;
	
	private String typePayment;
	
	private static LeaningEnglishAppication sLeaningEnglishAppication;

	@Override
	public void onCreate() {
		super.onCreate();
		
//		contactDAO = new ContactDaoImpl(this);
		
		sLeaningEnglishAppication = this;

		// initialize facebook configuration
		Permission[] permissions = new Permission[] {
			    Permission.USER_PHOTOS,
			    Permission.EMAIL,
			    Permission.PUBLISH_ACTION
			};

		SimpleFacebookConfiguration configuration = new SimpleFacebookConfiguration.Builder()
				.setAppId(getString(R.string.facebook_app_id))
				.setNamespace(getString(R.string.facebook_name_space))
				.setPermissions(permissions)
				.setDefaultAudience(SessionDefaultAudience.FRIENDS)
				.setAskForAllPermissionsAtOnce(false).build();

		SimpleFacebook.setConfiguration(configuration);
	}


	public UserEntity getUserEntity() {
		return userEntity;
	}

	public void setUserEntity(UserEntity userEntity) {
		this.userEntity = userEntity;
	}
	
	
	public static LeaningEnglishAppication getLeaningEnglishAppication(){
		return sLeaningEnglishAppication;
	}

	public ArrayList<LanguageEntity> getLanguageEntities() {
		return languageEntities;
	}

	public void setLanguageEntities(ArrayList<LanguageEntity> languageEntities) {
		this.languageEntities = languageEntities;
	}

	public static LeaningEnglishAppication getsLeaningEnglishAppication() {
		return sLeaningEnglishAppication;
	}

	public static void setsLeaningEnglishAppication(
			LeaningEnglishAppication sLeaningEnglishAppication) {
		LeaningEnglishAppication.sLeaningEnglishAppication = sLeaningEnglishAppication;
	}

	public LanguageEntity getLanguageEntity() {
		return languageEntity;
	}

	public void setLanguageEntity(LanguageEntity languageEntity) {
		this.languageEntity = languageEntity;
	}

	public CourseEntity getCourseEntity() {
		return courseEntity;
	}

	public void setCourseEntity(CourseEntity courseEntity) {
		this.courseEntity = courseEntity;
	}

	public int getLevelSelect() {
		return levelSelect;
	}

	public void setLevelSelect(int levelSelect) {
		this.levelSelect = levelSelect;
	}

	public ContactDAO getContactDAO() {
		return contactDAO;
	}

	public void setContactDAO(ContactDAO contactDAO) {
		this.contactDAO = contactDAO;
	}

	public String getTypePayment() {
		return typePayment;
	}

	public void setTypePayment(String typePayment) {
		this.typePayment = typePayment;
	}

	public boolean isLogin() {
		return isLogin;
	}

	public void setLogin(boolean isLogin) {
		this.isLogin = isLogin;
	}
	
	

}
